From 0e05a47ca4e680f7ed8d5ac5bce73e9caba737ac Mon Sep 17 00:00:00 2001 From: Mihir Nanavati Date: Tue, 3 Aug 2010 17:14:06 +0100 Subject: [PATCH] Allow PCI passthrough to PV guest without IOMMU Added a check which allows adding and removal of PCI devices for PV guests in the absence of an IOMMU. Signed-off-by: Mihir Nanavati Signed-off-by: Stefano Stabellini --- tools/libxl/libxl_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c index a4ae74bae0..98b49a2f30 100644 --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -416,7 +416,7 @@ static int do_pci_add(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev) out: if (!libxl_is_stubdom(ctx, domid, NULL)) { rc = xc_assign_device(ctx->xch, domid, pcidev->value); - if (rc < 0) { + if (rc < 0 && (hvm || errno != ENOSYS)) { XL_LOG_ERRNOVAL(ctx, XL_LOG_ERROR, rc, "xc_assign_device failed"); return ERROR_FAIL; } @@ -541,7 +541,7 @@ out: if (!libxl_is_stubdom(ctx, domid, NULL)) { rc = xc_deassign_device(ctx->xch, domid, pcidev->value); - if (rc < 0) + if (rc < 0 && (hvm || errno != ENOSYS)) XL_LOG_ERRNOVAL(ctx, XL_LOG_ERROR, rc, "xc_deassign_device failed"); } -- 2.30.2